package lambda;
import lambda.interF.MyConsumer;
import lambda.model.Student;
import java.util.function.Consumer;
public class Demo8 {
    public static void main(String[] args) {
        Student student=new Student("圆圆");
        //无参成员方法
        MyConsumer myConsumer=student::sayNoArgs;
        myConsumer.doMeth();
        //等价lambda
        Consumer<Student>consumer=(stu)->stu.sayNoArgs();
        consumer.accept(student);

        //有参成员方法
        Consumer<Integer> consumer1=student::sayHasArgs;
        consumer1.accept(666);
        //等价lambda
        Consumer<Student>consumer2=(stu)->stu.sayHasArgs(777);
        consumer2.accept(student);
    }
}
